package com.health.system.model.system;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.health.system.javacommon.base.BaseEntity;

public class Permission extends BaseEntity {
	
	//date formats
	
	//columns START
	private java.lang.String id;
	private java.lang.String name;
	private java.lang.String resource;
	private java.lang.String description;
	private java.lang.String parentId;
	private java.lang.String sort;
	
	private java.util.ArrayList idList;
	//columns END

	public Permission(){
	}

	public Permission(
		java.lang.String id
	){
		this.id = id;
	}

	public void setId(java.lang.String value) {
		this.id = value;
	}
	
	public java.lang.String getId() {
		return this.id;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setResource(java.lang.String value) {
		this.resource = value;
	}
	
	public java.lang.String getResource() {
		return this.resource;
	}
	public void setDescription(java.lang.String value) {
		this.description = value;
	}
	
	public java.lang.String getDescription() {
		return this.description;
	}
	public void setParentId(java.lang.String value) {
		this.parentId = value;
	}
	
	public java.lang.String getParentId() {
		return this.parentId;
	}
	public void setSort(java.lang.String value) {
		this.sort = value;
	}
	
	public java.lang.String getSort() {
		return this.sort;
	}

    public java.util.ArrayList getIdList() {
	    return idList;
    }

    public void setIdList(java.util.ArrayList idList) {
    	this.idList = idList;
    }

	public String toString() {
		return new ToStringBuilder(this)
			.append("Id",getId())
			.append("Name",getName())
			.append("Resource",getResource())
			.append("Description",getDescription())
			.append("ParentId",getParentId())
			.append("Sort",getSort())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.append(getName())
			.append(getResource())
			.append(getDescription())
			.append(getParentId())
			.append(getSort())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Permission == false) return false;
		if(this == obj) return true;
		Permission other = (Permission)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.append(getName(),other.getName())
			.append(getResource(),other.getResource())
			.append(getDescription(),other.getDescription())
			.append(getParentId(),other.getParentId())
			.append(getSort(),other.getSort())
			.isEquals();
	}
}

